using Business.ProvinceManagement;
using Business.ProvinceManagement.Dto;
using Business.WarehouseManagement.Dto;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;

namespace Business.Controllers
{
    [RemoteService]
    [Area("Business")]
    [Route("api/business/Province")]
    public class ProvinceController : AbpController
    {
        private readonly IProvinceAppService _ProvinceAppService;

        public ProvinceController(IProvinceAppService ProvinceAppService)
        {
            _ProvinceAppService = ProvinceAppService;
        }

        [HttpPost]
        [Route("data-post")]
        public Task<ProvinceDto> DataPost(CreateOrUpdateProvinceDto input)
        {
            return _ProvinceAppService.DataPost(input);
        }

        [HttpPost]
        [Route("delete")]
        public Task Delete(List<Guid> ids)
        {
            return _ProvinceAppService.Delete(ids);
        }

        [HttpGet]
        [Route("{id}")]
        public Task<ProvinceDto> Get(Guid id)
        {
            return _ProvinceAppService.Get(id);
        }

        [HttpGet]
        public Task<PagedResultDto<ProvinceDto>> GetAll(GetProvinceInputDto input)
        {
            return _ProvinceAppService.GetAll(input);
        }


        [HttpGet]
        [Route("tree")]
        public  Task<TreeTypeDto> GetTreeProvince()
        {
            return  _ProvinceAppService.GetTreeProvince();
        }
    }
}
